GOBUILD := GO111MODULE=on go build -mod=vendor
GOBUILDLINUX := GOOS=linux GOARCH=amd64 GO111MODULE=on go build
PKG := atomgit.com/atomgit_dev/git-hooks
VERSION := $(shell git describe --tags --always --dirty)

build:
	@$(GOBUILD) -o git-hooks -mod=vendor -ldflags "-X ${PKG}/cmd.Version=$(VERSION)"

linux: tidy
	@$(GOBUILDLINUX) -o git-hooks -mod=vendor -ldflags "-X ${PKG}/cmd.Version=$(VERSION)"

tidy:
	GOSUMDB=off GO111MODULE=on go mod tidy
	go mod vendor

fmt:
	go fmt